package com.hello.system.service.impl;

import java.util.List;
import com.hello.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.hello.system.mapper.ReportsMapper;
import com.hello.system.domain.Reports;
import com.hello.system.service.IReportsService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;

/**
 * 用户举报投诉Service业务层处理
 * 
 * @author hello
 * @date 2025-10-29
 */
@Slf4j
@Service
@RequiredArgsConstructor
public class ReportsServiceImpl extends ServiceImpl<ReportsMapper, Reports> implements IReportsService 
{
    private final ReportsMapper reportsMapper;

    /**
     * 查询用户举报投诉
     * 
     * @param reportId 用户举报投诉主键
     * @return 用户举报投诉
     */
    @Override
    public Reports selectReportsByReportId(Long reportId)
    {
        return reportsMapper.selectReportsByReportId(reportId);
    }

    /**
     * 查询用户举报投诉列表
     * 
     * @param reports 用户举报投诉
     * @return 用户举报投诉
     */
    @Override
    public List<Reports> selectReportsList(Reports reports)
    {
        return reportsMapper.selectReportsList(reports);
    }

    /**
     * 新增用户举报投诉
     * 
     * @param reports 用户举报投诉
     * @return 结果
     */
    @Override
    public int insertReports(Reports reports)
    {
        reports.setCreateTime(DateUtils.getNowDate());
        return reportsMapper.insertReports(reports);
    }

    /**
     * 修改用户举报投诉
     * 
     * @param reports 用户举报投诉
     * @return 结果
     */
    @Override
    public int updateReports(Reports reports)
    {
        reports.setUpdateTime(DateUtils.getNowDate());
        return reportsMapper.updateReports(reports);
    }


    /**
     * 批量删除用户举报投诉
     * 
     * @param reportIds 需要删除的用户举报投诉主键
     * @return 结果
     */
    @Override
    public int deleteReportsByReportIds(Long[] reportIds)
    {
        return reportsMapper.deleteReportsByReportIds(reportIds);
    }

    /**
     * 删除用户举报投诉信息
     * 
     * @param reportId 用户举报投诉主键
     * @return 结果
     */
    @Override
    public int deleteReportsByReportId(Long reportId)
    {
        return reportsMapper.deleteReportsByReportId(reportId);
    }
}
